#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

#define DEST_PORT 3334
#define DEST_IP	"127.0.0.1"
int main()
{
	int sockfd;
	struct sockaddr_in my_addr;
	if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
	{
		perror("Server-socket() error lol!");
		exit(1);
	}
	else
		printf("Server-socket() sockfd is OK\n");
	my_addr.sin_family = AF_INET;
	my_addr.sin_port = htons(DEST_PORT);
	my_addr.sin_addr.s_addr = inet_addr(DEST_IP);
	memset(&my_addr.sin_zero, 0, 8);

	if (connect(sockfd, (struct sockaddr*)&my_addr, sizeof(struct sockaddr)) < 0)
	{
		perror("Server-conn() error lol!");
		exit(1);
	}
	else
		printf("Server-conn() is OK\n");
	{
		char *s = "hello!";
		send(sockfd, s, strlen(s), 0);
	}
	return 0;
}
